﻿import CMenuClip;
class CMenuBox {
	var Caption:String;
	var label:String;
	var MenuArray:Array;
	public function CMenuBox(_Caption:String, _MenuArray:Array) {
		if (_Caption) {
			Caption = _Caption;
		} else {
			Caption = "DefaultMenuBox";
		}
		if (_Caption) {
			label = _Caption;
		} else {
			label = "DefaultMenuBox";
		}
		if (_MenuArray) {
			MenuArray = _MenuArray;
		} else {
			var tempArray:Array = getDefaultArray();
			trace(tempArray);
		}
	}
	public function TraceMe():Void {
		for (var i = 0; i<MenuArray.length; i++) {
			trace("		- MenuClip item	[Caption]	:"+MenuArray[i].Caption);
			trace("		- MenuClip item	[Action]	:"+MenuArray[i].Action);
		}
	}
	public function setMenuArray(value:Array):Void {
		MenuArray = value;
	}
	public function getMenuArray():Array {
		return MenuArray;
	}
	public function setCaption(value:String):Void {
		Caption = value;
	}
	public function getCaption():String {
		return Caption;
	}
	private function getDefaultArray():Array {
		var tempArray:Array = new Array();
		for (var i = 0; i<5; i++) {
			var tempCaption:String = "MenuClip"+i;
			var tempAction:String = "MenuClip.Action"+i;
			var MenuClip:CMenuClip = new CMenuClip(tempCaption, tempAction);
			tempArray.push(MenuClip);
		}
		return tempArray;
	}
}
